var adlPro;var adlOrd;var adlSite;var adlZone;var adlKv;var adlCCat;var adlHasDcopt;var adlHasATC;var adlDisSkyScreen;var adlHasMultZones;var adlRec;var adl3rdParty;var adlAdSZ;var adlAdKv;var adlAdSZone;var adlSGG;var adlSGA;var adlSGI;var adlSGS;var adlSGE;var adlSGP;var adlSG='';var adlTile;function initCommonVars(){if(typeof adlPro=='undefined'){adlPro=window.location.protocol=='https:'?'https:':'http:';}
if(typeof adlOrd=='undefined'){adlOrd=Math.floor(Math.random()*1000000000);}
if(typeof adlSite=='undefined'){adlSite='adlink.net';}
if(typeof adlZone=='undefined'){adlZone='';}
if(typeof adlKv=='undefined'){adlKv='';}
if(typeof adlCCat=='undefined'){adlCCat='';}
if(typeof adlHasDcopt=='undefined'){adlHasDcopt=true;}
if(typeof adlDisSkyScreen=='undefined'){adlDisSkyScreen=false;}
if(typeof adlHasMultZones=='undefined'){adlHasMultZones=false;}}
function initSGVars(){if(typeof adlSGG=='undefined'){adlSGG='';}else{addAdlSG(adlSGG,'g');}
if(typeof adlSGA=='undefined'){adlSGA='';}else{addAdlSG(adlSGA,'a');}
if(typeof adlSGI=='undefined'){adlSGI='';}else{addAdlSG(adlSGI,'i');}
if(typeof adlSGS=='undefined'){adlSGS='';}else{addAdlSG(adlSGS,'s');}
if(typeof adlSGE=='undefined'){adlSGE='';}else{addAdlSG(adlSGE,'e');}
if(typeof adlSGP=='undefined'){adlSGP='';}else{addAdlSG(adlSGP,'p');}}
function initBTVars(){if(typeof adlRec=='undefined'){adlRec='';}
if(typeof adlHasATC=='undefined'){adlHasATC=true;}
initAdditionalBTVars();}
function setTile(){adlTile=typeof adlTile=='undefined'?0:adlTile;}
function generateZonename(str_sz,str_subzone){var defDel="_";var subZone='';var z=adlZone;str_subzone=(typeof str_subzone!='undefined')?str_subzone:'';subZone=(str_subzone==''||str_subzone.search(/[\-\.\/]/)==0)?str_subzone:defDel+str_subzone;z=isTrue(adlHasMultZones)?adlZone+defDel+str_sz+subZone:adlZone+subZone;if(str_subzone.substring(0,2)=='??'){z=str_subzone.replace('??','');}
else if(str_subzone.substring(0,1)=='?'){z=adlZone+str_subzone.replace('?','');}
return(z!=''&&z.substr(z.length-1)!=';')?z.replace(",","-")+';':z.replace(",","-");}
function generateKV(str_kv){var adKv=(typeof str_kv!='undefined')?str_kv:'';var kv=adKv!=''?adKv:adlKv;return(kv!=''&&kv.substr(kv.length-1)!=';')?kv+';':kv;}
function addTestZone(z){if(z){return paramHasValue('pub','adlink_test')?'test_'+z:z;}
return'';}
function generateDebug(arr_var,str_sz){var arr_sz=getSizeArray(str_sz);document.write('');document.write('');document.write(' ');for(var i=0;i'+arr_el[0]+': '+arr_el[1]+'');}}
document.write(' ');document.write('');document.write('');}
function isSkyScraper(str_sz){return(str_sz=="120x600"||str_sz=="160x600"||str_sz=="160x600,120x600"||str_sz=="120x600,160x600");}
function adlDecode(str_encodedRcmd){var str_decodedRcmd='';if(typeof str_encodedRcmd!='undefined'&&str_encodedRcmd!=''){var arr_affinities=str_encodedRcmd.split(';');var today=new Date();var tsToday=today.getTime();var timeDiff=(tsToday>=arr_affinities[0])?Math.floor((tsToday-arr_affinities[0])/86400000):0;for(var i=1;i1){var args=url[1].split("&");for(var i=0;i1)?arr_sz[0]:str_sz;return sz.split("x");}
function executeATC(){if(isTrue(adlHasATC)){var setAdlRcmdPixel=new Image();if(adlSite&&adlZone){setAdlRcmdPixel.src=adlPro+'//tc.adlink.net/SetAdlRec.gif?'+'s='+escape(adlSite.removeWhitespaces())+'&z='+escape(adlZone.removeWhitespaces())+'&sg='+adlSG.replace(/;/g,'%3B').replace(/=/g,'%3D')+'&d='+adlOrd;}}}
function addAdlSG(sg,sgName){if(sg!=''){adlSG+=sgName+'='+escape(sg)+';';}}
function isIFrame(){try{if(top.location.href!=location.href){return true;}
return false;}catch(e){return false;}}
function initThiPaVars(){if(typeof adl3rdParty=='undefined'){adl3rdParty=false;}
if(typeof adlAdSZ=='undefined'){adlAdSZ=false;}
if(typeof adlAdSZone=='undefined'){adlAdSZone='';}
if(typeof adlAdKv=='undefined'){adlAdKv='';}}
function initAdditionalBTVars(){}
function getAdLinkAdTag(str_sz,str_subzone,str_kv){adlTile++;var adlDcopt=generateDcopt();var rcmd=generateRcmd();var z=generateZonename(str_sz,str_subzone);z=addTestZone(z);var kv=generateKV(str_kv);var tile=isTrue(adl3rdParty)?getTile(kv):'tile='+adlTile;var ord=isTrue(adl3rdParty)?getOrd(kv):';ord='+adlOrd;if(paramHasValue('pub','adlink_debug')){generateDebug([['sitename',adlSite],['adslot size',str_sz],['zonename',z],['key-values',kv],['tile',tile],['dcopt',adlDcopt],['content category',adlCCat],['ord',ord]],str_sz);}
else{generateDFPCall(z,rcmd,kv,str_sz,adlDcopt,tile,ord);}}
function generateDcopt(){return(isTrue(adlHasDcopt)&&adlTile==1)?'dcopt=ist;':'';}
function generateRcmd(){return'';}
function generateDFPCall(z,rcmd,kv,str_sz,adlDcopt,tile,ord){var dom=adlPro=='https:'?getDFPSslDomain():getDFPDomain();var checkSize=typeof str_sz!='undefined'&&isTrue(adlDisSkyScreen)&&isSkyScraper(str_sz);var adSrc=adlPro+'//'+dom+'/adj/'+adlSite+'/'+z+rcmd+adlRec+kv+'sz='+str_sz+';'+adlDcopt+tile+ord+'?';if(!(checkSize&&window.screen.availWidth<1024)){document.write('<\/scr'+'ipt>');}}
function getTile(kv){var arr_kv=kv.split(';');for(var i=0;i